Check the PHP version from composer.json require.php

Open Beginner friendly
#66 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
json, php, python
Domain
devtools

Research direction

Start with the RUNTIMES list in src/devready/checks/runtimes.py and the extractor pattern there, then read SAFE_SPEC in versions.py and the explain.py entries. Add a php runtime row and a composer.json extractor that reads only require.php via json.loads, returning it only if it matches SAFE_SPEC. Done when composer.json with ^8.1 and PHP 7.4 installed yields one fail showing both versions, a repo without composer.json yields no PHP result, and pytest plus ruff check and ruff format --check pass.

Written by the indexing model from the issue text.

Description

enhancement good first issue help wanted

Problem: A PHP project declares its PHP version in composer.json ("require": {"php": "^8.1"}). DevReady does not check PHP, so a too-old or missing php only shows up when composer install fails.

Do:

  • Add a php row to RUNTIMES in src/devready/checks/runtimes.py (exe php, args --version, .tool-versions name php). Runtimes are only checked when the project declares them, so nothing changes for other repos.
  • Add an extractor for composer.json: json.loads, read require.php only, return it only if it matches SAFE_SPEC in versions.py (^, ~, || are already supported).
  • Id: project.php.composer, miss = fail (Composer refuses to install on a platform mismatch).
  • Add the explain.py entry, a docs/checks.md row, a CHANGELOG line, the README check list mention and unit tests (match, too old, missing php, no require.php, invalid JSON, hostile spec).

Done when:

  • composer.json with "php": "^8.1" and PHP 7.4 installed gives one fail showing both versions.
  • A repo without composer.json gets no PHP result.

Done when: see the list above, plus pytest, ruff check and ruff format --check pass.

Notes:

  • Read-only: never execute project files, never echo file contents; only a validated version or spec reaches the report.
  • No network, no new runtime dependencies (Python >= 3.10 stdlib only).
  • Comment below to claim it and I will assign you.
Dominant language
Python
Stars
2
Forks
3
Avg merge
10h 51m
Merged PRs (30d)
40

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Evalogical-Inc/devReady

All issues in Evalogical-Inc/devReady

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.