hanneskod / classtools Goto Github PK
View Code? Open in Web Editor NEWFind, extract and process php classes from the file system
License: Do What The F*ck You Want To Public License
Find, extract and process php classes from the file system
License: Do What The F*ck You Want To Public License
PHP Fatal error: Uncaught Error: Class 'PhpParser\Node\Scalar\String_' not found in /Users/username/projects/my-app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php:2842
Stack trace:
#0 /Users/username/projects/my-app/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php(247): PhpParser\Parser\Php5->reduceRule476()
#1 /Users/username/projects/my-app/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php(58): PhpParser\ParserAbstract->parse('<?php\n\nnamespac...')
#2 /Users/username/projects/my-app/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php(29): PhpParser\Parser\Multiple->tryParse(Object(PhpParser\Parser\Php5), '<?php\n\nnamespac...')
#3 /Users/username/projects/my-app/vendor/hanneskod/classtools/src/Transformer/Reader.php(61): PhpParser\Parser\Multiple->parse('<?php\n\nnamespac...')
#4 /Users/username/projects/my-app/vendor/hanneskod/classtools/src/Iterator/SplFileInfo.php(53): hanneskod\classtools\Transformer\Reader->__construct('<?php\n\nnamespac...')
#5 /Users/username/Google D in /Users/username/projects/my-app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php on line 2842
Fatal error: Uncaught Error: Class 'PhpParser\Node\Scalar\String_' not found in /Users/username/projects/my-app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php:2842
Stack trace:
#0 /Users/username/projects/my-app/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php(247): PhpParser\Parser\Php5->reduceRule476()
#1 /Users/username/projects/my-app/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php(58): PhpParser\ParserAbstract->parse('<?php\n\nnamespac...')
#2 /Users/username/projects/my-app/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php(29): PhpParser\Parser\Multiple->tryParse(Object(PhpParser\Parser\Php5), '<?php\n\nnamespac...')
#3 /Users/username/projects/my-app/vendor/hanneskod/classtools/src/Transformer/Reader.php(61): PhpParser\Parser\Multiple->parse('<?php\n\nnamespac...')
#4 /Users/username/projects/my-app/vendor/hanneskod/classtools/src/Iterator/SplFileInfo.php(53): hanneskod\classtools\Transformer\Reader->__construct('<?php\n\nnamespac...')
#5 /Users/username/projects in /Users/username/projects/my-app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php on line 2842
It was working fine last time I checked this project (1 week ago). Now when I got back at it, it keeps spitting this errror.
What could this be? That other package is using the correct package version which should've fixed this problem.
Help would be appreciated.
php-parser is now at v 1.0
(also fpdi?)
Seems this package is missing a LICENSE.md
Your application has a total of 1 package(s) that you may not be legally allowed to use. By default, we assume the MIT, Apache-2.0, ISC, BSD Clause 2 & 3 and LGPL licenses to be legally valid for use for proprietary or commercial applications. However, you are free to change this in the Enlightn config. Unsafe packages include [hanneskod/classtools: WTFPL]
Documentation URL: https://www.laravel-enlightn.com/docs/security/license-analyzer.html
Would you mind adding one, preferably MIT like Laravel PHP?
When hanneskod/readme-tester#4 is resolved.
Hello, i would like to use this library, but i can't because i have a dependency with nikic/php-parser v4.1.
Is it possibile to upgrade this? https://github.com/hanneskod/classtools/blob/master/composer.json#L21
composer.json
"require": {
"hanneskod/classtools": "^1.0",
"nikic/php-parser": "^4.1"
},
result:
Problem 1
- hanneskod/classtools 1.1.3 requires nikic/php-parser ^3 -> satisfiable by nikic/php-parser[3.x-dev, v3.0.0, v3.0.0alpha1, v3.0.0beta1, v3.0.0beta2, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.1.0, v3.1.1, v3.1.2, v3.1.3, v3.1.4, v3.1.5] but these conflict with your requirements or minimum-stability.
- hanneskod/classtools 1.1.2 requires nikic/php-parser ^3.0 -> satisfiable by nikic/php-parser[3.x-dev, v3.0.0, v3.0.0alpha1, v3.0.0beta1, v3.0.0beta2, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.1.0, v3.1.1, v3.1.2, v3.1.3, v3.1.4, v3.1.5] but these conflict with your requirements or minimum-stability.
- hanneskod/classtools 1.1.1 requires nikic/php-parser ~2.0 -> satisfiable by nikic/php-parser[2.x-dev, v2.0.0, v2.0.0alpha1, v2.0.0beta1, v2.0.1, v2.1.0, v2.1.1] but these conflict with your requirements or minimum-stability.
- hanneskod/classtools 1.1.0 requires nikic/php-parser ~2.0 -> satisfiable by nikic/php-parser[2.x-dev, v2.0.0, v2.0.0alpha1, v2.0.0beta1, v2.0.1, v2.1.0, v2.1.1] but these conflict with your requirements or minimum-stability.
- hanneskod/classtools 1.0.1 requires nikic/php-parser ~2.0 -> satisfiable by nikic/php-parser[2.x-dev, v2.0.0, v2.0.0alpha1, v2.0.0beta1, v2.0.1, v2.1.0, v2.1.1] but these conflict with your requirements or minimum-stability.
- hanneskod/classtools 1.0.0 requires nikic/php-parser ~1.0 -> satisfiable by nikic/php-parser[1.x-dev, v1.0.0, v1.0.0beta1, v1.0.0beta2, v1.0.1, v1.0.2, v1.1.0, v1.2.0, v1.2.1, v1.2.2, v1.3.0, v1.4.0, v1.4.1] but these conflict with your requirements or minimum-stability.
- hanneskod/classtools 1.1.3 requires nikic/php-parser ^3 -> satisfiable by nikic/php-parser[3.x-dev, v3.0.0, v3.0.0alpha1, v3.0.0beta1, v3.0.0beta2, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.1.0, v3.1.1, v3.1.2, v3.1.3, v3.1.4, v3.1.5] but these conflict with your requirements or minimum-stability.
- Installation request for hanneskod/classtools ^1.0 -> satisfiable by hanneskod/classtools[1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.1.3].
Minimizer should be able to take a FilterableClassIterator and merge all the found classes to one file.
For this to work Minimizer must parse the namespace (even multiple namespaces) in each file. And translate the use statements for that namespaced block.
Implement using https://github.com/nikic/PHP-Parser
If a scan encounters a non valid php file php-parser aborts an throws an exception. This exception could be caught and handled instead of just dieing.
Unclear what the default behaviour should be. Maybe a setting on ClassIterator?
It would be nice to be able to tell ClassIterator what pahts to skip, what extensions to include and so on.
A symfony\Finder might be helpful here.
Or even i Flysystem to enable ClassIterator to find classes from remote sources...
ClassLoader
objects.ClassLoader
could be a psr-11 compatible container..ClassLoaderInterface
to FilterInterface
. The current setup does not pass static analysis.ClassDefinition
objects instead of ReflectionClass
. Better encapsulation.where
filter.A number of my class methods have been converted to PHP 7.1 nullable return types.
https://wiki.php.net/rfc/nullable_types
It seems that any class which contains a method which implements nullable return types triggers an error and the class isn't included in the classmap.
Here's an example class which causes this bug:
public static function someMethod( string $some_param ) : ?string {
return null;
}
This gives me an error that looks like this:
Array ( [0] => Syntax error, unexpected '?' on line 10 in /path/to/my/class.php )
At the moment, classtools has a dependency on symfony/finder ~2.7. This is not compatible with Symfony 3.0 und therefore, the library cannot be used with current Symfony versions.
At the moment it is not possible to install the package with Symfony v6.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.