{"id":14987198,"url":"https://github.com/codeigniter4/devkit","last_synced_at":"2025-04-09T10:10:34.434Z","repository":{"id":38417476,"uuid":"425542844","full_name":"codeigniter4/devkit","owner":"codeigniter4","description":"Development toolkit for CodeIgniter libraries and projects","archived":false,"fork":false,"pushed_at":"2024-07-24T01:20:37.000Z","size":272,"stargazers_count":58,"open_issues_count":1,"forks_count":11,"subscribers_count":9,"default_branch":"develop","last_synced_at":"2024-10-29T15:31:55.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeigniter4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-07T15:35:45.000Z","updated_at":"2024-08-19T00:48:50.000Z","dependencies_parsed_at":"2023-11-30T01:25:58.703Z","dependency_job_id":"f2aa3422-1936-471e-a5f1-26ce7be9bfdc","html_url":"https://github.com/codeigniter4/devkit","commit_stats":{"total_commits":170,"total_committers":6,"mean_commits":"28.333333333333332","dds":0.6882352941176471,"last_synced_commit":"a9dcba75f6245a9311be9777f80700f77b28052f"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeigniter4%2Fdevkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeigniter4%2Fdevkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeigniter4%2Fdevkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeigniter4%2Fdevkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeigniter4","download_url":"https://codeload.github.com/codeigniter4/devkit/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018061,"owners_count":21034048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T14:14:14.650Z","updated_at":"2025-04-09T10:10:34.405Z","avatar_url":"https://github.com/codeigniter4.png","language":"PHP","readme":"# CodeIgniter DevKit\n\nDevelopment toolkit for CodeIgniter libraries and projects\n\n## Installation\n\nInstall via Composer:\n\n```console\ncomposer config minimum-stability dev\ncomposer config prefer-stable true\ncomposer require --dev codeigniter4/devkit\n```\n\n## Included Dependencies\n\n### Styles and Standards\n\n* [CodeIgniter Coding Standard](https://github.com/CodeIgniter/coding-standard)\n* [NexusPHP CS Config](https://github.com/NexusPHP/cs-config)\n\n### Testing and Analysis\n\n* [NexusPHP Tachycardia](https://github.com/NexusPHP/tachycardia)\n* [PHPStan](https://phpstan.org/user-guide/getting-started)\n* [PHPUnit](https://phpunit.readthedocs.io)\n* [Psalm](https://psalm.dev)\n\n### Mocking\n\n* [FakerPHP](https://fakerphp.github.io)\n* [VFS Stream](https://github.com/bovigo/vfsStream/wiki)\n\n### Security\n\n* [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates)\n* [Roave Security Advisories](https://github.com/Roave/SecurityAdvisories)\n\n### Additional Tools\n\nThese are integrated into the workflows but not included via Composer. If you want to use them\nlocally they will need to be installed. All of them (except Rector) are available via [Phive](https://phar.io/#Tools).\n\n* [Composer Normalize](https://github.com/ergebnis/composer-normalize)\n* [Composer Unused](https://github.com/composer-unused/composer-unused)\n* [Deptrac](https://github.com/qossmic/deptrac)\n* [Infection](https://infection.github.io/)\n* [PHP Coveralls](https://php-coveralls.github.io/php-coveralls/)\n* [PHP CS Fixer](https://cs.symfony.com/)\n* [Rector](https://github.com/rectorphp/rector/)\n\n## Template Files\n\nThe provided source files (in **Template/**) should be considered guidelines for your own use,\nas they may need changing to fit your environment. These are based on the following assumptions:\n\n1. Your default repository branch is set to `develop`\n2. You use Composer to manage all necessary dependencies\n3. Your source code is located in **app/** (for projects) or **src/** (for libraries)\n4. Your unit tests are located in **tests/**\n5. Your CodeIgniter dependency is `codeigniter4/framework` (some paths need to be changed for `dev-develop`)\n\n### Workflows\n\nThis kit includes a number of workflow templates for integrating [GitHub Actions](https://docs.github.com/en/actions)\ninto your library or project development process. To add these to your repo simply copy the\nworkflows into a **Template/.github/workflows/** directory.\n\n\u003e [!TIP]\n\u003e The [source files](src/.github) also include a configuration for Dependabot which\n\u003e will help keep your dependencies and workflows updated.\n\nBelow is a brief description of each workflow; see the links above for help with each tool.\n\n#### Deptrac\n\n*Requires **depfile.yaml***\n\nDeptrac is a \"dependency tracing\" tool that allows developers to define which components should\nbe allowed to access each other. This helps keep your project architecture logical and concise\nby enforcing the rules you set. For example, you may want to impose an MVC-style architecture\nby allowing a `Controller` to use any `Model` but not vice-versa.\n\n#### Infection\n\n*Requires **infection.json.dist***\n\nJust because your tests reach a high level of code coverage does not mean they are comprehensive.\nMutation Testing is a way of gauging the *quality* of your unit tests. A silly example: your\ncode has an increment function with a single unit test for 100% coverage:\n\n```php\nfunction increment(int $num1, int $num2): int\n{\n    return $num1 + $num2;\n}\n\nfunction testIncrementWithZero()\n{\n    $result = increment(42, 0);\n    $this-\u003eassertSame(42, $result);\n}\n```\n\nInfection will re-run your unit test against \"mutated\" versions of your code that *should*\ncause failures and report \"escaped mutations\" when they still pass. In this example, Infection\nmutates your `increment()` function to use `-` instead of `+`, but since your test case\nstill asserts `42` as the result it is considered an \"escape\" and you should plan to add\nmore tests.\n\n#### PHPCPD\n\nPHP Copy-Paste Detector analyzes your code and reports when there are blocks of duplicate code\nmore than a certain number of lines long (default: 5). In most cases this is a sign of poor\ncode structure and an opportunity to consolidate classes or functions.\n\n#### PHP CS Fixer\n\nPHP CS Fixer is used to enforce coding standards. Once the rules are defined in the config file\nthe workflow will check your code against the definitions and fail for any deviance.\n\n#### PHPStan\n\n*Requires **phpstan.neon.dist***\n\nStatic analysis is a major factor in catching bugs and issues before they happen. PHPStan will\nanalyze your code for mistakes based on the configuration supplied.\n\n#### PHPUnit\n\n*Requires **phpunit.xml.dist***\n\nUnit testing automates running your code through all the possible scenarios before putting it\ninto use in production. PHPUnit is a highly-configurable framework and suite for writing and\nrunning unit tests. This workflow also configures PHPUnit to report on code coverage and\nupload the results to [Coveralls.io](https://coveralls.io) (you will need a free account,\nbut it is also fine to use this workflow without Coveralls).\n\n#### Rector\n\n*Requires **rector.php***\n\nRector provides automated refactoring of code, allowing you to make sweeping updates based on\npredefined rulesets. Rector can be highly opinionated based on its configuration file (**rector.php**)\nso be sure to read the documentation and figure out the best fit for you. This workflow performs\na \"dry run\" to check for any changes that Rector would have made and fail if there are matches.\n\n\u003e [!NOTE]\n\u003e Rector updates rules all the time, so you may want to lock your repo to\n\u003e the latest known working version of Rector to prevent unexpected failures.\n\u003e Using pinned version in `composer.json` and update it with dependabot is the\n\u003e best practice.\n\n#### Unused\n\nComposer Unused does one thing: checks that your code actually uses the dependencies you\nhave included via Composer. It can be easy to forget to update your **composer.json** when\nyour code drops a dependency, so this workflow will help track those down.\n\n### Hosting with Vagrant\n\n\u003e [!NOTE]\n\u003e The `Vagrantfile.dist` is unmaintained. It might not work now.\n\u003e Contributions are welcome.\n\nVirtualization is an effective way to test your webapp in the environment you\nplan to deploy on, even if you develop on a different one.\nEven if you are using the same platform for both, virtualization provides an\nisolated environment for testing.\n\nThe codebase comes with a **src/Template/Vagrantfile.dist**, that can be copied to **Vagrantfile**\nand tailored for your system, for instance enabling access to specific database or caching engines.\n\n#### Setting Up\n\nIt assumes that you have installed [VirtualBox](https://www.virtualbox.org/wiki/Downloads) and\n[Vagrant](https://www.vagrantup.com/downloads.html)\nfor your platform.\n\nThe Vagrant configuration file assumes you have set up a [ubuntu/bionic64 Vagrant box](https://app.vagrantup.com/ubuntu/boxes/bionic64) on your system:\n\n```console\n\u003e vagrant box add ubuntu/bionic64\n```\n\n#### Testing\n\nOnce set up, you can then launch your webapp inside a VM, with the command:\n\n```console\n\u003e vagrant up\n```\n\nYour webapp will be accessible at http://localhost:8080, with the code coverage\nreport for your build at http://localhost:8081 and the user guide for\nit at http://localhost:8082.\n\n## Example Files\n\nBesides the template files, this repo includes some examples for integrating CodeIgniter\nwith other third-party resources. These files (in **Examples/**) may change over time and\nshould not be relied on for anything more than a reference for your own code.\n","funding_links":[],"categories":["Development"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeigniter4%2Fdevkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeigniter4%2Fdevkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeigniter4%2Fdevkit/lists"}