PHPackages                             michabbb-backup/x-ray - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. michabbb-backup/x-ray

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

michabbb-backup/x-ray
=====================

Quickly scan source code for calls to Ray

016PHP

Since Mar 16Pushed 2y agoCompare

[ Source](https://github.com/michabbb-backup/x-ray)[ Packagist](https://packagist.org/packages/michabbb-backup/x-ray)[ RSS](/packages/michabbb-backup-x-ray/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Quickly scan source code for calls to Ray
=========================================

[](#quickly-scan-source-code-for-calls-to-ray)

 [![x-ray logo](https://camo.githubusercontent.com/425fb6b07e3919ab27ad1bd2ded59c252ec134aaba0b771b5975b8929d689648/68747470733a2f2f7374617469632e7065726d6166726f73742e6465762f696d616765732f782d7261792f782d7261792d6c6f676f2e706e67)](https://camo.githubusercontent.com/425fb6b07e3919ab27ad1bd2ded59c252ec134aaba0b771b5975b8929d689648/68747470733a2f2f7374617469632e7065726d6166726f73742e6465762f696d616765732f782d7261792f782d7261792d6c6f676f2e706e67)

 [![Package Version](https://camo.githubusercontent.com/b248dedc3f60570b5613716570889243fcc5191729baabae84ec8b1ad38dec23/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7370617469652f782d7261792e7376673f736f72743d73656d766572266c6f676f3d676974687562)](https://camo.githubusercontent.com/b248dedc3f60570b5613716570889243fcc5191729baabae84ec8b1ad38dec23/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7370617469652f782d7261792e7376673f736f72743d73656d766572266c6f676f3d676974687562) [![license](https://camo.githubusercontent.com/5dc7dff358a950068f09fdcc2d538ba034b6c5ac3ff8516a00394aec33ef07de/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7370617469652f782d7261792e7376673f6c6f676f3d6f70656e736f75726365696e6974696174697665)](https://camo.githubusercontent.com/5dc7dff358a950068f09fdcc2d538ba034b6c5ac3ff8516a00394aec33ef07de/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7370617469652f782d7261792e7376673f6c6f676f3d6f70656e736f75726365696e6974696174697665) [![Test Run Status](https://camo.githubusercontent.com/ba80700102fd2bf588721b25607669ae5b136251a9fcc09d878d506ae8aff890/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f782d7261792f72756e2d74657374732e796d6c3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/ba80700102fd2bf588721b25607669ae5b136251a9fcc09d878d506ae8aff890/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f782d7261792f72756e2d74657374732e796d6c3f7374796c653d666c61742d737175617265) [![Downloads](https://camo.githubusercontent.com/4c9738c59ba1c22a58f716d4eeadf5468888aa721b6cb18888858ae71533e1ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f782d7261792e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/4c9738c59ba1c22a58f716d4eeadf5468888aa721b6cb18888858ae71533e1ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f782d7261792e7376673f7374796c653d666c61742d737175617265)

This package can quickly scan source code for calls to `ray()`, `rd()`, `Ray::*`, and `->ray()` helper methods from the [spatie/ray](https://github.com/spatie/ray) and [spatie/laravel-ray](https://github.com/spatie/laravel-ray) packages.

The primary use case is when calls to `ray()` cannot be left in source code before deploying, even if ray is disabled. This package does NOT remove the calls, it simply displays their locations so they can be removed manually.

The exit code of the `x-ray` command is zero if no ray calls are found, and non-zero if calls are found. This allows the package to be used in an automated environment such as Github Workflows.

Visit [myray.app](https://myray.app) for information on downloading the Ray debugging app.

Installation
------------

[](#installation)

```
composer require spatie/x-ray --dev
```

Usage
-----

[](#usage)

Specify one or more valid path names and/or filenames to scan:

```
./vendor/bin/x-ray ./app/Actions/MyAction.php ./app/Models/*.php ./tests --snippets
```

Display a summary table of the located calls within `./src` and `./tests` while also ignoring some files:

```
./vendor/bin/x-ray \
  --summary \
  --ignore src/MyClass.php \
  --ignore 'test/fixtures/*.php' \
  ./src ./tests
```

Display each filename &amp; pass/fail status, along with compact results:

```
./vendor/bin/x-ray ./app --compact --verbose
```

Available Options
-----------------

[](#available-options)

FlagDescription`--compact` or `-c`Minimal output. Display each result on a single line.`--github` or `-g`GitHub Annotation output. Use `error` command to create annotation. Useful when you are running x-ray within GitHub Actions.`--ignore` or `-i`Ignore a file or path, can be specified multiple times. Accepts glob patterns.`--no-progress` or `-P`Don't display the progress bar while scanning files`--snippets` or `-S`Display code snippets from located calls`--summary` or `-s`Display a summary of the files/calls discovered`--verbose` or `-v`Display each filename and pass/fail status while scanning. Implies `--no-progress`.Configuration files
-------------------

[](#configuration-files)

Create a file named `x-ray.yml` or `x-ray.yml.dist` in the root directory of your project to configure the package.

If the configuration file exists, it must have the root sections `functions` and `paths`.

Each section may have an `ignore` or `include` item, both, or neither. Each item contains an array of strings, and includes override ignores if an entry exists in both. Add a `*` item to ignore or include all matches *(make sure to quote the asterisk)*.

By default, `functions.include` matches the `ray` and `rd` functions.

```
functions:
  include:
    - '*'

paths:
  include:
    - 'tests/fixtures/*'
  ignore:
    - tests
    - 'SettingsTest.php'
```

Automation
----------

[](#automation)

`x-ray` was designed to be used not only as a manual utility, but in conjunction with automation tools.

Github workflows
----------------

[](#github-workflows)

You may use `x-ray` within a github workflow to help ensure you don't commit any calls to `ray()`.

The following example workflow runs unit tests with PHPUnit and then runs `x-ray`:

```
name: run-tests

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: true
      matrix:
        os: [ubuntu-latest]
        php: [8.3, 8.2, 8.1]

    name: P${{ matrix.php }} - ${{ matrix.os }}

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
          coverage: pcov

      - name: Setup problem matchers
        run: |
          echo "::add-matcher::${{ runner.tool_cache }}/php.json"
          echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

      - name: Install dependencies
        run: composer update --prefer-stable --prefer-dist --no-interaction

      - name: Execute tests
        run: ./vendor/bin/phpunit

      - name: Check for ray calls
        run: ./vendor/bin/x-ray . --compact
```

Git hooks
---------

[](#git-hooks)

In some cases you may want to use a git `pre-commit` hook to avoid commiting any `ray()` calls:

```
#!/bin/sh

echo "Checking for ray() calls...\n"

x-ray -s .
rayScanExitCode=$?

printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -

localPreCommitExitCode=0
if [ -e ./.git/hooks/pre-commit ]; then
    ./.git/hooks/pre-commit "$@"
    localPreCommitExitCode=$?
fi

exit $rayScanExitCode || $localPreCommitExitCode
```

You can also use `x-ray` with husky in your `package.json` configuration:

```
...
"husky": {
    "hooks": {
        "pre-commit": "lint-staged && .x-ray -s ."
    }
},
....
```

Screenshots
-----------

[](#screenshots)

Various screenshots can be viewed in [the docs](docs/screenshots.md).

Testing
-------

[](#testing)

```
./vendor/bin/phpunit
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Patrick Organ](https://github.com/patinthehat)
- [Alex Vanderbist](https://github.com/AlexVanderbist)
- [Tom Witkowski](https://github.com/Gummibeer)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 89.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b55e1bd77bbfeea3c978026b32a120cfe9d7024f288247e0617cb62562d49a7d?d=identicon)[michabbb-backup](/maintainers/michabbb-backup)

---

Top Contributors

[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (322 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![colinmackinlay](https://avatars.githubusercontent.com/u/7833362?v=4)](https://github.com/colinmackinlay "colinmackinlay (3 commits)")[![michabbb-backup](https://avatars.githubusercontent.com/u/10455759?v=4)](https://github.com/michabbb-backup "michabbb-backup (2 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (2 commits)")[![jasonvarga](https://avatars.githubusercontent.com/u/105211?v=4)](https://github.com/jasonvarga "jasonvarga (1 commits)")[![binotaliu](https://avatars.githubusercontent.com/u/67255597?v=4)](https://github.com/binotaliu "binotaliu (1 commits)")

### Embed Badge

![Health badge](/badges/michabbb-backup-x-ray/health.svg)

```
[![Health](https://phpackages.com/badges/michabbb-backup-x-ray/health.svg)](https://phpackages.com/packages/michabbb-backup-x-ray)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M910](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k28](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
