Skip to content

Allows to access PHP class properties and methods with snake_case or camelCase at the same time

License

Notifications You must be signed in to change notification settings

micropackage/casegnostic

Repository files navigation

Casegnostic

BracketSpace Micropackage Latest Stable Version PHP from Packagist Total Downloads License

Micropackage logo

🧬 About Casegnostic

Package that simplifies transition from one coding standard to other, namely from snake_case to camelCase or vice-versa.

When you're about to break compatibility by changing method name from something_important() to somethingImportant() you can simply attach the trait.

use Micropackage\Casegnostic\Casegnostic;

class Example
{
	use Casegnostic;

	public function somethingImportant()
	{
		return true;
	}
}

$x = new Example();

// That works as expected:
$x->somethingImportant();

// But that works too! 🤯
$x->something_important();

💾 Installation

composer require micropackage/casegnostic

🕹 Usage

Simply attach the trait to your class.

use Micropackage\Casegnostic\Casegnostic;

class Example
{
	use Casegnostic;
}

📦 About the Micropackage project

Micropackages - as the name suggests - are micro packages with a tiny bit of reusable code, helpful particularly in WordPress development.

The aim is to have multiple packages which can be put together to create something bigger by defining only the structure.

Micropackages are maintained by BracketSpace.

📖 Changelog

See the changelog file.

📃 License

GNU General Public License (GPL) v3.0. See the LICENSE file for more information.

About

Allows to access PHP class properties and methods with snake_case or camelCase at the same time

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages