-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from ajthinking/avoid-str-macros
Avoid str macros
- Loading branch information
Showing
7 changed files
with
84 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
namespace Archetype\Support; | ||
|
||
use Illuminate\Support\Str; | ||
|
||
class LaravelStrings | ||
{ | ||
public static function hasOneMethodName($target) | ||
{ | ||
return Str::camel( | ||
class_basename($target) | ||
); | ||
} | ||
|
||
public static function hasManyMethodName($target) | ||
{ | ||
return Str::camel( | ||
Str::plural( | ||
class_basename($target) | ||
) | ||
); | ||
} | ||
|
||
public static function belongsToMethodName($target) | ||
{ | ||
return Str::camel( | ||
class_basename($target) | ||
); | ||
} | ||
|
||
public static function belongsToManyMethodName($target) | ||
{ | ||
return Str::camel( | ||
Str::plural( | ||
class_basename($target) | ||
) | ||
); | ||
} | ||
|
||
public static function hasOneDocBlockName($target) | ||
{ | ||
return Str::studly( | ||
class_basename($target) | ||
); | ||
} | ||
|
||
public static function hasManyDocBlockName($target) | ||
{ | ||
return Str::studly( | ||
Str::plural( | ||
class_basename($target) | ||
) | ||
); | ||
} | ||
|
||
public static function belongsToDocBlockName($target) | ||
{ | ||
return Str::studly( | ||
class_basename($target) | ||
); | ||
} | ||
|
||
public static function belongsToManyDocBlockName($target) | ||
{ | ||
return Str::studly( | ||
Str::plural( | ||
class_basename($target) | ||
) | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.