Download the PHP package flarone/reflection without Composer

On this page you can find all versions of the php package flarone/reflection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package reflection

php-reflection-deflector

Latest Stable Version Total Downloads Latest Unstable Version License
Test your Private/Protected Methods/Properties with any testing package and with Zero configuration.

New: Can reflect multiple classes at same time.

Usage

Step 1: Install Through Composer

Step 2: Import the trait

Import the Flarone\Reflection\ReflectableTrait in your TestClass of any package. Eg: PhpUnit, PhpSpec, Laracasts\Integrated.

For PhpUnit

And That's it. You are all set to go. :)

Now you can do the following to test private/protected methods or properties:

Instantiate the Reflector

By using reflect() method like this:

This Method is not chainable
Note: Its preferable to use this in constructor or for PhpUnit in setUp() method etc.

By using on() method like this:

This method is chainable Note: This method relfects the class object only once. That is only for one call to method or property. It can be used for relfecting multiple classes at same time.

Available Methods

reflect($classObj);

Description: Reflect the Class Object

on($classObj);

Description: Reflect the Class Object. This is Chainable Method.
Possible Chaining:



call($method, $arguments = []);

Description: Call any valid public/Private/Protected Method of reflected Class Object. This is not Chainable Method.

call{Method}($arguments = []);

Description: Same as call() but dynamically calls the method. This is not Chainable Method.
{method} Can be any valid public/private/protected method of reflected Class Object.

get($property);

Description: Get the value of any valid Public/Private/Protected property of the reflected Class Object. This is not Chainable Method.

get{Property};

Description: Same as get() but dynamically gets the value of the property. This is not Chainable Method.
{property} Can be any valid Public/Private/Protected property of the reflected Class Object.

set($name, $value);

Description: Set the value of valid Public/Private/Protected property of the reflected Class Object. This is not Chainable Method.

set{Property} = $value;

Description: Same as set() but dynamically sets the value of the property. This is not Chainable Method.
{property} Can be any valid Public/Private/Protected property of the reflected Class Object.

-

Reflect Multiple classes at same time

Example:

Contribution

Feel free to report issues or make Pull Requests. If you find this document can be improved in any way, please feel free to open an issue for it.

License

The php-reflection-deflector was forked from skagarwal/reflection. The php-reflection-deflector is open-sourced software licensed under the MIT license


All versions of reflection with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package flarone/reflection contains the following files

Loading the files please wait ....