PHPackages                             onx/code-spy - 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. onx/code-spy

ActiveLibrary

onx/code-spy
============

Package for CodeSpy app

1.1.0(2y ago)013MITPHPPHP ^8.1

Since Feb 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Zdezorientowany/OnxCodeSpy)[ Packagist](https://packagist.org/packages/onx/code-spy)[ RSS](/packages/onx-code-spy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

CodeSpy Integration Package
===========================

[](#codespy-integration-package)

The CodeSpy Integration Package provides a powerful `spyOn` global function designed to enhance debugging efforts in your codebase. This function allows for seamless communication with the CodeSpy app, enabling real-time monitoring and analysis of your code's execution. It's an essential tool for developers looking to gain deeper insights into their applications, identify issues more efficiently, and improve code quality.

Features
--------

[](#features)

- **Global `spyOn` Function**: Easily integrate debugging statements into your code without invasive changes.
- **Communication with CodeSpy App**: Leverages the CodeSpy app for an enriched debugging experience, offering a graphical interface to view your code's behavior.
- **Serialization Support**: Pass objects to the `spyOn` function, which serializes them into JSON for comprehensive examination. Ideal for inspecting complex data structures.
- **Configurable Recursion Depth**: Customize the depth of serialization for deeper inspection of nested objects. This feature allows developers to balance between detail and performance.
- **Troubleshooting Made Easy**: With the ability to serialize objects and control the depth of recursion, developers can pinpoint issues more effectively, saving time and effort in debugging.

Prerequisites
-------------

[](#prerequisites)

To use this package, you must have the CodeSpy app installed. The app facilitates the visualization and management of debugging data collected through the `spyOn` function.

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

[](#installation)

Install the package via Composer with the following command:

```
composer require onx/code-spy
```

This command adds the CodeSpy Integration Package to your project, enabling you to start debugging with enhanced capabilities immediately.

Usage
-----

[](#usage)

To debug your code with the `spyOn` function, simply pass the target object and optionally specify the recursion depth for serialization. Here's a basic example:

```
spyOn($yourObject, $recursionDepth);
```

Parameters:

- `$yourObject` (required): The object or data you wish to inspect.
- `$recursionDepth` (optional): An integer representing how many levels deep the serialization should go. Be cautious with deep serialization as it may impact performance and possibly cause issues if set too high.

### Example

[](#example)

```
// Debugging a complex array structure with recursion depth set to 2
$arrayToDebug = ['key1' => 'value1', 'key2' => ['subkey1' => 'subvalue1']];
spyOn($arrayToDebug, 2);

// Debugging an object with default recursion depth
$objectToDebug = new MyClass();
spyOn($objectToDebug);
```

Troubleshooting Tips
--------------------

[](#troubleshooting-tips)

- **Handling Deep Serialization**: If you encounter issues or performance degradation due to deep serialization, consider decreasing the recursion depth. This helps to mitigate potential memory overflow or excessive processing time.
- **Debugging in Production**: It's highly recommended to avoid or limit the use of `spyOn` in production environments. If necessary, ensure that it's used conditionally and removed or disabled after use to prevent any security or performance issues.
- **Data Overload**: When debugging very large or complex objects, you might experience slowdowns or crashes. To avoid this, serialize only the most relevant parts of the object or reduce the recursion depth.

License
-------

[](#license)

The CodeSpy Integration Package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). This permissive license allows for unrestricted use, modification, and distribution of the software, making it an excellent choice for developers and companies alike.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

837d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e974f2eb3f25ba615cea3382a04196ef55ffb1edc00dbf93d5a024d2d4c4cfaf?d=identicon)[watashi](/maintainers/watashi)

---

Top Contributors

[![Zdezorientowany](https://avatars.githubusercontent.com/u/49677053?v=4)](https://github.com/Zdezorientowany "Zdezorientowany (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/onx-code-spy/health.svg)

```
[![Health](https://phpackages.com/badges/onx-code-spy/health.svg)](https://phpackages.com/packages/onx-code-spy)
```

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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