Completed
Push — master ( 792b51...4c6650 )
by Lars
08:38
created

Create.php ➔ create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 3
b 0
f 1
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Stringy;
4
5
if (!function_exists('Stringy\create')) {
6
  /**
7
   * Creates a Stringy object and returns it on success.
8
   *
9
   * @param  mixed  $str      Value to modify, after being cast to string
10
   * @param  string $encoding The character encoding
11
   *
12
   * @return Stringy A Stringy object
13
   * @throws \InvalidArgumentException if an array or object without a
14
   *         __toString method is passed as the first argument
15
   */
16
  function create($str, $encoding = null)
17
  {
18
    return new Stringy($str, $encoding);
19
  }
20
}
21