jasonmccreary
Repos
131
Followers
431

A code generation tool for Laravel developers.

2264
207

A set of helpful assertions when testing Laravel applications.

269
22

This repository contains the Docker stack for my local LAMP development

46
24

Local system files to quickly set up my command line, shell, and Git preferences.

18
4

Events

Remove unused unit tests

Support -G and --data-urlencode

Created at 3 days ago
jasonmccreary create tag v0.2.0
Created at 4 days ago

Make it available all the time

Created at 4 days ago

Track earliest constraint for PHP versions

Created at 6 days ago
issue comment
Default to plural api route naming, with config to allow plural or singular

I'm going to be working on Blueprint in my live streams during the month of October. I will start with this.

Created at 1 week ago
delete branch
jasonmccreary delete branch stringable-casting
Created at 1 week ago
issue comment
Add methods to get request data as integer or float

Clarity and consistency with other parts of the framework. However, there are instances of both types of casting. So feel free to open a follow-up PR. 👍

Created at 1 week ago
issue comment
Add methods to get request data as integer or float

Something that came up in my live stream and separately on Twitter is the integer conversion of '2_000' to 2. While a literal 2_000 is equivalent to 2000 in PHP, the string 2_000 is not.

Someone is welcome to support this edge case, but I felt it better to align with PHP. There's an argument for PHP to update the behavior of intval(). In which case, this would just work.

Created at 1 week ago
delete branch
jasonmccreary delete branch http-int-cast
Created at 1 week ago
pull request opened
Add methods to get request data as integer or float

This adds methods to conveniently retrieve and cast request data as an int and float. A bool cast already existed. So why not have other common scalar types.

Before

intval($request->input('some_int_value'));
floatval($request->input('some_float_value'));

After

$request->integer('some_int_value');
$request->float('some_float_value');
Created at 1 week ago
create branch
jasonmccreary create branch http-int-cast
Created at 1 week ago
pull request opened
Add methods to cast Stringables

This adds methods to conveniently cast stringables in common data types similar to those found in Laravel's HTTP Request.

Before

intval(str('shift-worker-01')->afterLast('-')->toString());
floatval(str('Result: 1.23')->after(':')->trim()->toString());
str('YeS')->lower()->toString() === 'yes';
Carbon::parse(str('DOB: 12-31-2001')->after(':')->trim()->toString());

After

str('shift-worker-01')->afterLast('-')->toInteger();
str('Result: 1.23')->after(':')->trim()->toFloat();
str('YeS')->lower()->toBoolean();
str('DOB: 12-31-2001')->after(':')->trim()->toDate();
Created at 1 week ago
create branch
jasonmccreary create branch stringable-casting
Created at 1 week ago
delete branch
jasonmccreary delete branch use-batch-fake
Created at 1 week ago
issue comment
[9.x] Add Model::withoutTimestamps(...)

Yeah, I've run into this before. Disabling timestamps is a tricky beast and heavily dependent on the use case.

Created at 1 week ago
Unsupported operand types: int + string

Desktop:

  • OS: Mac
  • OS Version: Monterey
  • App Version: 12.6

Describe the bug

Deprecated: Invalid characters passed for attempted conversion, these have been ignored in phar:///opt/shift/workbench/helpers.php on line 270

Fatal error: Uncaught TypeError: Unsupported operand types: int + string in phar:///opt/shift/workbench/helpers.php:270
Stack trace:
#0 phar:///opt/shift/workbench/workbench.php(43): checksum(' 175560ea-d237-...')
#1 /opt/shift/workbench(9): require('phar:///opt/shi...')
#2 {main}
  thrown in phar:///opt/shift/workbench/helpers.php on line 270
--------------
Build failed

To Reproduce Steps to reproduce the behavior:

  1. Go to '[Adopt early returns]'
  2. Run
Created at 2 weeks ago
Unsupported operand types: int + string

From the partial stack trace, it seems your license key has a prefixing space. Please ensure you did not copy/paste this incorrectly.

Created at 2 weeks ago
pull request opened
Add helper to dispatch fake job batches

This adds a helper method to the BusFake for quickly dispatching a fake job batch with no jobs for testing purpose. It's similar to the new Job helper added in #44104, but when you want to test a batch outside of a job.

Before:

Bus::fake();

$batch = Bus::batch([])->dispatch();
Cache::put('batched-automation', $batch->id);

Shift::runAutomation('v9.31.0'); // cancels previous batched job

Bus::assertDispatched(UpdateRepositories::class);
$this->assertTrue($batch->cancelled());

After

Bus::fake();

$batch = Bus::dispatchFakeBatch();
// ...

For convenience of testing, you may optionally pass the name of the batch. If your test requires more detail, you may continue to create and dispatch a batch with the longhand methods.

Created at 2 weeks ago
create branch
jasonmccreary create branch batch-helper
Created at 2 weeks ago
pull request opened
Update BusFake to use new BatchFake

This updates the changes in my previous PR to use the since created BatchFake. I did not change the docblocks to keep this an implementation detail. If you feel there is value in changing them so the developer knows they are interacting with a BatchFake, I'm glad to update them.

Created at 2 weeks ago
create branch
jasonmccreary create branch use-batch-fake
Created at 2 weeks ago
jasonmccreary create tag v0.2.2
Created at 2 weeks ago
closed issue
Remote is incorrectly parsed when branch is having `/` in the name

Hi there, we are using branch names with / because they group nicely in some git clients. I would love to use your package with remote repo but sadly it does not work 😢

When running git trim --merged --remote --dry-run

The output is e.g.

API-FEAT/APP-173-add-delete-offers-request will be deleted from origin/API-FEAT.
API-FIX/APP-188-handle-empty-fields-on-update-webhook will be deleted from origin/API-FIX.

And if run without --dry-run nothing happens. I assume it's because remote is incorrectly parsed origin/API-FEAT instead of only origin. Branch name is correct though.

Unfortunately I'm not proficient enough to fix it and submit a PR but I recon problem is on lines https://github.com/jasonmccreary/git-trim/blob/main/git-trim#L156 https://github.com/jasonmccreary/git-trim/blob/main/git-trim#L187

EDIT: I think replacing ${name%/*} with ${name%%/*} would do it 🤞 . Same for ${branch%/*}. Test though 🙏

Created at 2 weeks ago
issue comment
Remote is incorrectly parsed when branch is having `/` in the name

Sorry all. Notifications were turned off and didn't realize this hadn't been addressed.

Created at 2 weeks ago

Extract remote to the first forward slash only (#16)

Created at 2 weeks ago
pull request closed
Extract remote to the first forward slash only

Fix for ISSUE #15 hopefully. Please test

Created at 2 weeks ago
issue comment
Extract remote to the first forward slash only

@vr00 sorry for the delay here. My notifications were turned off and this slipped through the cracks. I'm merging this now and would appreciate if you could manually copy down the latest from main and let me know if this works before I tag a release.

Created at 2 weeks ago
closed issue
`git trim --help` does not show manual entry
❯ git trim --help
No manual entry for git-trim

❯ git-trim --help
usage: git trim [options]

    Removes merged, pruned, untracked, and stale branches within a repository.
    https://github.com/jasonmccreary/git-trim/

Available options are:
    --all                 remove all local branches, except the current branch
    --dry-run             prints branches which will be removed instead of deleting them
    -m, --merged          remove local branches already merged into the current branch
    -p, --pruned          remove local branches where its remote branch no longer exists
    -r, --remote          remove remote branches instead of local branches
    --reset[=...]         remove all local branches except those existing on remote (default: origin)
    -s, --stale           remove local branches without commits in the last 3 months
    -t, --tracked         remove the tracking branch from remote
    -u, --untracked       remove local branches not tracking a remote branch

Created at 2 weeks ago