Download the PHP package cspray/annotated-target without Composer

On this page you can find all versions of the php package cspray/annotated-target. 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 annotated-target

Annotated Target

A static analysis tool for PHP 8 to gather all the places Attributes are used in a given codebase. In short, give this tool a set of directories, and we'll provide a Generator that yields information wherever an Attribute is found. You can filter by Attribute types to get info for just the things you need. Check out the Quick Start below for more info.

Install

Use [Composer]() to install this package.

Quick Start

The core concept in Annotated Target is an interface called AnnotatedTarget that tracks information about each place an Attribute is used in your codebase. It provides three pieces of data:

  1. The Reflector that the Attribute was targeting. For example, if the Attribute was found targeting a class then a ReflectionClass would be available.
  2. The ReflectionAttribute for the Attribute.
  3. The instance for the given Attribute.

Let's take a look at some annotated code and how you'd get access to the parsed Attributes. We'll assume that this code exists in __DIR__ . 'src/Foo.php'.

Now, to get access to these Attribute we need to parse the source code. This is accomplished using the Cspray\AnnotatedTarget\parseAttributes function, or you could use the Cspray\AnnotatedTarget\PhpParserAnnotatedTargetParser directly. The parseAttributes function is the recommended way of interacting with this library.

If you want to get all Attributes you can pass just the directories to scan. The library will take a look at all source files in the directory that end with .php and statically analyze them for Attribute uses. The first argument accepts either a string or an array, in case you have more than 1 directory to scan.

If you only care about certain Attributes you can pass a second argument to parseAttributes, an array of Attribute types that we should filter by. For example, to get only the #[MethodAttr] Attribute we'd run the following.


All versions of annotated-target with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
nikic/php-parser Version ^v4.18 || ^5.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 cspray/annotated-target contains the following files

Loading the files please wait ...