Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create initial Number utility package #1

Merged
merged 16 commits into from
Nov 30, 2023
Merged

Conversation

caendesilva
Copy link
Collaborator

@caendesilva caendesilva commented Nov 29, 2023

Abstract

Hey everyone! Quick introduction here. I'm Caen, creator of the Number PR of Laravel. In this repo I'm porting that utility so it can be used in all PHP projects. This is my first Friends Of PHP Package, so I'm starting this discussion to ensure that everything matches the style and structure of your other packages.

Checklist

Composer package name

I based the package name on the PHP-CS-Fixer package. Is this okay?

composer require friendsofphp/number

Utility namespace

Is this an appropriate namespace?

use FriendsOfPhp\Number\Number;

Number::format(1234567.89);

Coding styles

Which coding style should we use? Code is currently formatted according to the PER standard: www.php-fig.org/per/coding-style

Documentation site

How do you want to handle documentation? My go-to for simple packages is to use GitHub Pages to create a static site from the README (or Markdown docs in the repo) using HydePHP. (For example hydephp.github.io/action and git.desilva.se/Speacher which both just need a short GitHub Actions workflow)

@caendesilva caendesilva changed the title Merge 'caendesilva/php-number' into 'FriendsOfPHP/number' Create initial Number utility package Nov 29, 2023
@caendesilva caendesilva marked this pull request as draft November 29, 2023 09:30
composer.json Show resolved Hide resolved
src/Number.php Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
tests/Feature/NumberTest.php Show resolved Hide resolved
tests/Feature/NumberTest.php Show resolved Hide resolved
tests/Pest.php Outdated Show resolved Hide resolved
.github/workflows/tests.yml Outdated Show resolved Hide resolved
caendesilva and others added 10 commits November 29, 2023 12:31
Convention for directories is with trailing `/`

Co-authored-by: Greg Korba <wirone@gmail.com>
Co-authored-by: Greg Korba <wirone@gmail.com>
From #1 (comment)

Examples can be improved:

- assigning to variable is not needed and is redundant (like `$spelledNumber` vs `Number::spell()`)
- instead of commenting the intent, which is clear by the class+method itself, there should be actual output
Not needed as we don't specify anything custom here

See #1 (comment)
Not needed as we don't specify anything custom here
Uses complete descriptions to be proper sentences that describes the intent

Resolves #1 (comment)
Co-authored-by: Greg Korba <wirone@gmail.com>
Since PHP is not SemVer, we should rather limit upper version to the newest available one, which can be tested.

Co-Authored-By: Greg Korba <wirone@gmail.com>
@caendesilva caendesilva force-pushed the create-number-utility branch from 2d8bd68 to e379ec8 Compare November 29, 2023 13:06
While the code should run fine on 8.0, the libraries we use for testing do not, and I don't think a work around is worth it since 8.0 is no longer supported and 8.1 is the minimum official PHP version.
@caendesilva caendesilva marked this pull request as ready for review November 30, 2023 12:16
@caendesilva caendesilva merged commit b958c2f into main Nov 30, 2023
4 checks passed
@caendesilva caendesilva mentioned this pull request Nov 30, 2023
2 tasks
@caendesilva caendesilva deleted the create-number-utility branch November 30, 2023 17:45
@caendesilva
Copy link
Collaborator Author

@Wirone Think we could get this published to packagist?

@Wirone
Copy link
Contributor

Wirone commented Nov 6, 2024

It wasn't published 🙈? I don't have rights to the org on Packagist, unfortunately. @dragoonis was coordinating this package, maybe he can help.

@caendesilva
Copy link
Collaborator Author

It wasn't published 🙈? I don't have rights to the org on Packagist, unfortunately. @dragoonis was coordinating this package, maybe he can help.

Nope, realized today it still was not published 🙈🙈 Wasn't sure who to ping

@dragoonis
Copy link

Whoever has Merge rights should merge this to this organisation as it's own repo.

Who is going to do it?

@dragoonis
Copy link

@Wirone ping the right people.

@Wirone
Copy link
Contributor

Wirone commented Nov 6, 2024

Whoever has Merge rights should merge this to this organisation as it's own repo.

Who is going to do it?

It's already merged, but it needs to be added to Packagist by someone with access to friendsofphp vendor. I don't know who's there 😅.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants