<commit_before>Ubiq [![Build Status](https://secure.travis-ci.org/Pixel418/Ubiq.png)](http://travis-ci.org/Pixel418/Ubiq)
======

Functions for readable treatment of string, array & object: [see the documentation](https://github.com/Pixel418/Ubiq/blob/master/doc/index.md#readme)



Let's code
-------- 

### An example without Ubiq 

```php
function get_namespace( $class ) {

	// Allow to pass an object or a class as parameter
	if ( is_object( $class ) ) {
		$class = get_class( $class );
	}

	// Allow to pass a class with or without the first '\'
	if ( substr( $class, 0, 1 ) != '\\' ) {
		$class = '\\' . $class;
	}

	// Remove the class name from the namespace
	return substr( $class, 0, strrpos( $class, '\\' ) );
}
```

### The same example with Ubiq 

```php
function get_namespace( $class ) {
	\UObject\must_be_class( $class );
	return \UString\substr_before_last( $class, '\\' );
}
```

### Or even better

```php
function get_namespace( $class ) {
	return \UObject\get_namespace( $class );
}
```



License
--------

Staq is under [MIT License](http://opensource.org/licenses/MIT).



Community
--------

Staq is created and maintained by [<NAME>](http://zilliox.me). <br><commit_msg>Add a contribute paragraph<commit_after>Ubiq [![Build Status](https://secure.travis-ci.org/Pixel418/Ubiq.png)](http://travis-ci.org/Pixel418/Ubiq)
======

Functions for readable treatment of string, array & object: [see the documentation](https://github.com/Pixel418/Ubiq/blob/master/doc/index.md#readme)



Let's code
-------- 

### An example without Ubiq 

```php
function get_namespace( $class ) {

	// Allow to pass an object or a class as parameter
	if ( is_object( $class ) ) {
		$class = get_class( $class );
	}

	// Allow to pass a class with or without the first '\'
	if ( substr( $class, 0, 1 ) != '\\' ) {
		$class = '\\' . $class;
	}

	// Remove the class name from the namespace
	return substr( $class, 0, strrpos( $class, '\\' ) );
}
```

### The same example with Ubiq 

```php
function get_namespace( $class ) {
	\UObject\must_be_class( $class );
	return \UString\substr_before_last( $class, '\\' );
}
```

### Or even better

```php
function get_namespace( $class ) {
	return \UObject\get_namespace( $class );
}
```



License
--------

Ubiq is under [MIT License](http://opensource.org/licenses/MIT).



Community
--------

Ubiq is created and maintained by [<NAME>](http://zilliox.me). <br>

### How to Contribute

1. Fork the Ubiq repository
2. Create a new branch for each feature or improvement
3. Send a pull request from each feature branch to the **develop** branch

If you don't know much about pull request, please read [the Github article](https://help.github.com/articles/using-pull-requests).

All pull requests must follow this particular style guide and accompanied by passing [phpunit](https://github.com/sebastianbergmann/phpunit/) tests.
{'fraction_non_alphanumeric': 0.17142857142857143, 'fraction_numerical': 0.009407665505226481, 'mean_word_length': 3.5070643642072215, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '37426', 'n_tokens_mistral': 1020, 'n_tokens_neox': 947, 'n_words': 279}