Skip to content

Commit

Permalink
Merge pull request #25 from ddebowczyk/main
Browse files Browse the repository at this point in the history
Fixes: Util/Env, Mixin example
  • Loading branch information
ddebowczyk committed Sep 17, 2024
2 parents 55731cb + b34bd49 commit 78597ca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
modules = ["php-8.2", "bash"]
run = "./hub.sh run 1"

[nix]
channel = "stable-24_05"

[deployment]
run = ["sh", "-c", "./hub.sh run 1"]
4 changes: 2 additions & 2 deletions examples/A01_Basics/BasicViaMixin/run.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ static public function infer(
$loader = require 'vendor/autoload.php';
$loader->add('Cognesy\\Instructor\\', __DIR__ . '../../src/');

use Cognesy\Instructor\Extras\Mixin\HandlesInference;
use Cognesy\Instructor\Extras\Mixin\HandlesSelfInference;

class User {
use HandlesInference;
use HandlesSelfInference;

public int $age;
public string $name;
Expand Down
6 changes: 5 additions & 1 deletion src/Utils/Env.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ public static function set(string|array $paths, string|array $names = '') : void
}

public static function get(mixed $key, mixed $default = null) : mixed
{
{
$value = getenv($key);
if ($value !== false) {
return $value;
}
if (!isset(self::$dotenv)) {
self::load();
}
Expand Down

0 comments on commit 78597ca

Please sign in to comment.