Git Product home page Git Product logo

autowired's People

Contributors

chapcz avatar enumag avatar fprochazka avatar janbukva avatar janlanger avatar matej21 avatar paveljurasek avatar xificurk 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autowired's Issues

ReflectionProperty::getDeclaringClass doesn't work with traits

I tried to write a trait with its own dependencies and for laziness I used the @autowire annotation in that trait. Turns out it only works with fully-qualified @var annotation but not with use statements.

The reason is that if the property was declared in a trait, ReflectionProperty::getDeclaringClass() returns the class that uses the trait, not the trait itself. Because of that the use statements are read from wrong file.

More information about the topic as well as possible solution is here: http://mouf-php.com/blog/php_reflection_api_traits

Should I send a PR using the solution from the article above or are you against such solution?

Stable tags

Could you please create stable tags for Nette 2.2 version that contains 1723f8f?

And maybe for 2.1 too? :-)

Weird behavior with @var Foo|Bar

Having @var \Nette\Localization\ITranslator|\App\Translator leads to a weird exception Class "Nette\Localization\ITranslator|\App\Translator" was not found.

Question: Kdyby/Autowired vs @inject annotation

I would like to ask you what are the differences between Kdyby/Autowired and @inject annotation used in Nette. To me it looks like Kdyby/Autowired was created before @inject annotation was impemented into Nette so it is "useless" now.

Only differences I can see is that you can't @inject into protected methods (which is more or less just semantic approach) and that there is some "magic" with component factories in Kdyby/Autowired which I don't clearly understand.

I would appreciate your help here, @hosiplan :-) Thank you for your time.

Using in Symfony Console commands

Hi,

is there any reason why to limit usage only for Components:

if (! $this instanceof Nette\Application\UI\Component) {
	throw new MemberAccessException('Trait ' . __TRAIT__ . ' can be used only in descendants of ' . Nette\Application\UI\Component::class . '.');
}

?

I'm using it (successfully) also in Symfony Console Commands.

Thank you for your opinion.

nette 2.4 compatibility

Argument 1 passed to App\Presenters\Base::validateProperty() must be an instance of Nette\Reflection\Property, instance of ReflectionProperty given, called in ..../vendor/kdyby/autowired/src/Kdyby/Autowired/AutowireProperties.php on line 78

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.