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

Errors with examples #48

Closed
bautrukevich opened this issue Jan 14, 2020 · 2 comments
Closed

Errors with examples #48

bautrukevich opened this issue Jan 14, 2020 · 2 comments

Comments

@bautrukevich
Copy link
Contributor

This is not a documentation issue, I think, but I don't know where to post it.

First of all, in this topic https://cycle-orm.dev/docs/intro-quick-start and in Schema Generation chapter when I am trying to dump

print_r($classLocator->getClasses());

I get warnings:

( ! ) Deprecated: Class Zend\Hydrator\ClassMethods is deprecated, please use Zend\Hydrator\ClassMethodsHydrator instead in /Users/siarhei/Code/experiments/try-cycle-orm/vendor/zendframework/zend-hydrator/src/ClassMethods.php on line 21
--

1 | 0.0003 | 402736 | {main}( ) | .../index.php:0
2 | 0.0013 | 428736 | Spiral\Tokenizer\ClassLocator->getClasses( ) | .../index.php:32
3 | 0.7740 | 560928 | Spiral\Tokenizer\ClassLocator->classReflection( ) | .../ClassLocator.php:30
4 | 0.7740 | 561464 | __construct ( ) | .../AbstractLocator.php:93
5 | 0.7740 | 561520 | spl_autoload_call ( ) | .../AbstractLocator.php:93
6 | 0.7740 | 561576 | Composer\Autoload\ClassLoader->loadClass( ) | .../AbstractLocator.php:93
7 | 0.7741 | 561736 | Composer\Autoload\includeFile( ) | .../ClassLoader.php:322
8 | 0.7741 | 561976 | include( '/Users/siarhei/Code/experiments/try-cycle-orm/vendor/zendframework/zend-hydrator/src/ClassMethods.php' ) | .../ClassLoader.php:444
9 | 0.7741 | 562296 | trigger_error ( ) | .../ClassMethods.php:21

Deprecated: Class Zend\Hydrator\ArraySerializable is deprecated, please use Zend\Hydrator\ArraySerializableHydrator instead in /Users/siarhei/Code/experiments/try-cycle-orm/vendor/zendframework/zend-hydrator/src/ArraySerializable.php on line 21
--


1 | 0.0003 | 402736 | {main}( ) | .../index.php:0
2 | 0.0013 | 428736 | Spiral\Tokenizer\ClassLocator->getClasses( ) | .../index.php:32
3 | 0.7756 | 585696 | Spiral\Tokenizer\ClassLocator->classReflection( ) | .../ClassLocator.php:30
4 | 0.7756 | 586232 | __construct ( ) | .../AbstractLocator.php:93
5 | 0.7756 | 586288 | spl_autoload_call ( ) | .../AbstractLocator.php:93
6 | 0.7756 | 586344 | Composer\Autoload\ClassLoader->loadClass( ) | .../AbstractLocator.php:93
7 | 0.7757 | 586504 | Composer\Autoload\includeFile( ) | .../ClassLoader.php:322
8 | 0.7757 | 588448 | include( '/Users/siarhei/Code/experiments/try-cycle-orm/vendor/zendframework/zend-hydrator/src/ArraySerializable.php' ) | .../ClassLoader.php:444
9 | 0.7757 | 588768 | trigger_error ( ) | .../ArraySerializable.php:21
Deprecated: Class Zend\Hydrator\Reflection is deprecated, please use Zend\Hydrator\ReflectionHydrator instead in /Users/siarhei/Code/experiments/try-cycle-orm/vendor/zendframework/zend-hydrator/src/Reflection.php on line 21
--

1 | 0.0003 | 402736 | {main}( ) | .../index.php:0
2 | 0.0013 | 428736 | Spiral\Tokenizer\ClassLocator->getClasses( ) | .../index.php:32
3 | 0.7772 | 619952 | Spiral\Tokenizer\ClassLocator->classReflection( ) | .../ClassLocator.php:30
4 | 0.7772 | 620488 | __construct ( ) | .../AbstractLocator.php:93
5 | 0.7772 | 620544 | spl_autoload_call ( ) | .../AbstractLocator.php:93
6 | 0.7772 | 620600 | Composer\Autoload\ClassLoader->loadClass( ) | .../AbstractLocator.php:93
7 | 0.7773 | 620760 | Composer\Autoload\includeFile( ) | .../ClassLoader.php:322
8 | 0.7773 | 621000 | include( '/Users/siarhei/Code/experiments/try-cycle-orm/vendor/zendframework/zend-hydrator/src/Reflection.php' ) | .../ClassLoader.php:444
9 | 0.7773 | 621320 | trigger_error ( ) | .../Reflection.php:21
Deprecated: Class Zend\Hydrator\ObjectProperty is deprecated, please use Zend\Hydrator\ObjectPropertyHydrator instead in /Users/siarhei/Code/experiments/try-cycle-orm/vendor/zendframework/zend-hydrator/src/ObjectProperty.php on line 21
--

1 | 0.0003 | 402736 | {main}( ) | .../index.php:0
2 | 0.0013 | 428736 | Spiral\Tokenizer\ClassLocator->getClasses( ) | .../index.php:32
3 | 0.7777 | 624368 | Spiral\Tokenizer\ClassLocator->classReflection( ) | .../ClassLocator.php:30
4 | 0.7777 | 624904 | __construct ( ) | .../AbstractLocator.php:93
5 | 0.7777 | 624960 | spl_autoload_call ( ) | .../AbstractLocator.php:93
6 | 0.7777 | 625016 | Composer\Autoload\ClassLoader->loadClass( ) | .../AbstractLocator.php:93
7 | 0.7777 | 625176 | Composer\Autoload\includeFile( ) | .../ClassLoader.php:322
8 | 0.7777 | 690952 | include( '/Users/siarhei/Code/experiments/try-cycle-orm/vendor/zendframework/zend-hydrator/src/ObjectProperty.php' ) | .../ClassLoader.php:444
9 | 0.7777 | 691272 | trigger_error ( ) | .../ObjectProperty.php:21

and I get printed classes.

But, after that when I am trying to create a schema receive fatal error:

Fatal error: Cannot declare class Psr\Log\Test\DummyTest, because the name is already in use in /Users/siarhei/Code/experiments/try-cycle-orm/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php on line 140
--
1 | 0.0003 | 414288 | {main}( ) | .../index.php:0
2 | 0.8121 | 2184360 | Cycle\Schema\Compiler->compile( ) | .../index.php:50
3 | 0.8121 | 2184360 | Cycle\Annotated\Embeddings->run( ) | .../Compiler.php:43
4 | 0.8121 | 2184360 | Spiral\Tokenizer\ClassLocator->getClasses( ) | .../Embeddings.php:55
5 | 1.7872 | 2445008 | Spiral\Tokenizer\ClassLocator->classReflection( ) | .../ClassLocator.php:30
6 | 1.7872 | 2445544 | __construct ( ) | .../AbstractLocator.php:93
7 | 1.7872 | 2445608 | spl_autoload_call ( ) | .../AbstractLocator.php:93
8 | 1.7872 | 2445672 | Composer\Autoload\ClassLoader->loadClass( ) | .../AbstractLocator.php:93
9 | 1.7873 | 2445832 | Composer\Autoload\includeFile( ) | .../ClassLoader.php:322

What I am doing wrong? Help me, please
Thank you.

@wolfy-j
Copy link
Contributor

wolfy-j commented Jan 14, 2020

Hmmm, I would strongly recommend you exclude a vendor from directories available to class locator. Not only it will work 10 times faster but you also won't discover weird stuff people put into their libraries.

@bautrukevich
Copy link
Contributor Author

Oh, I understand! I am scanning all directories with Finder, including the vendor. Stupid mistake. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants