Code Monkey home page Code Monkey logo

classtools's People

Contributors

digilist avatar efrane avatar hanneskod avatar peter279k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

classtools's Issues

Uncaught Error: Class 'PhpParser\Node\Scalar\String_' not found

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.

License Missing

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?

Support nikic/php-parser 4.1

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


Error

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].

Classtools dies on erroneous php files

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?

More flexible file search in 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...

Ver 2 todo list

  • Let’s not be finder-centric when creating ClassLoader objects.
  • ClassLoader could be a psr-11 compatible container..
  • Move some methods from ClassLoaderInterface to FilterInterface. The current setup does not pass static analysis.
  • Iterate over ClassDefinition objects instead of ReflectionClass. Better encapsulation.
  • Develop the where filter.

Classes which contain methods with PHP 7.1 nullable return types trigger error

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 )

Add Symfony 3.0 support

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.