Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to run examples whatever current directory is #201

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/01-resolving-simple-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use phpDocumentor\Reflection\TypeResolver;

require '../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';

$typeResolver = new TypeResolver();

Expand Down
2 changes: 1 addition & 1 deletion examples/02-resolving-classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use phpDocumentor\Reflection\Types\Context;
use phpDocumentor\Reflection\TypeResolver;

require '../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';

$typeResolver = new TypeResolver();

Expand Down
2 changes: 1 addition & 1 deletion examples/03-resolving-all-elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use phpDocumentor\Reflection\Types\Context;
use phpDocumentor\Reflection\FqsenResolver;

require '../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';

$fqsenResolver = new FqsenResolver();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\ContextFactory;

require '../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';
require 'Classy.php';

$typeResolver = new TypeResolver();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\ContextFactory;

require '../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';
require 'Classy.php';

$typeResolver = new TypeResolver();
Expand Down
4 changes: 2 additions & 2 deletions examples/06-discovering-the-context-using-file-contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
use phpDocumentor\Reflection\TypeResolver;
use phpDocumentor\Reflection\Types\ContextFactory;

require '../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';

$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();

$contextFactory = new ContextFactory();
$context = $contextFactory->createForNamespace('My\Example', file_get_contents('Classy.php'));
$context = $contextFactory->createForNamespace('My\Example', file_get_contents(__DIR__ . '/Classy.php'));

// Class named: \phpDocumentor\Reflection\Types\Resolver
var_dump((string)$typeResolver->resolve('Types\Resolver', $context));
Expand Down
Loading