Code Monkey home page Code Monkey logo

funct's People

Contributors

alekgit avatar artengin avatar aurimasniekis avatar chrjean avatar dfridrich avatar digitalroll avatar hansott avatar iselldonuts avatar jremes-foss avatar kyl0b1te avatar lucantisswann avatar mokevnin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

funct's Issues

tests does not work on php7.1

There was 1 error:

  1. Funct\Tests\Collection\CollectionSizeTest::testCollectionSize with data set #3 (null, true, 0)
    count(): Parameter must be an array or an object that implements Countable

/Users/mokevnin/mokevnin/funct/src/Collection.php:508
/Users/mokevnin/mokevnin/funct/src/Tests/Collection/CollectionSizeTest.php:34

--

There were 2 failures:

  1. Funct\Tests\Strings\StringsIsLowerTest::testStringIsLower with data set #16 ('ąčęėįšųūž', false, true)
    Failed asserting that false matches expected true.

/Users/mokevnin/mokevnin/funct/src/Tests/Strings/StringsIsLowerTest.php:52

  1. Funct\Tests\Strings\StringsIsLowerTest::testStringIsLower with data set #18 ('ĄČĘĖĮŠŲŪŽ', false, true)
    Failed asserting that false matches expected true.

/Users/mokevnin/mokevnin/funct/src/Tests/Strings/StringsIsLowerTest.php:52

Merge group functions to single file

To improve performance, we will need to merge functions of same group to single file. This will save some time instead fo loading every single file.

String Functions

A list of string functions to implement for Version 0.1

  • string_between($string, $left, $right) (Extracts a string between $left and $right strings)
  • string_camelize
  • string_chomp_left($string, $prefix) (Removes $prefix from start of string)
  • string_chomp_right($string, $suffix) (Removes $suffix from end of string)
  • string_collapse_whitespace($string) (Converts all adjacent whitespace characters to a single space)
  • string_contains($string, $subString) (Returns true if the string contains $subString)
  • string_count ($string, $subString) (Returns the count of the number of occurrences of the $subString)
  • string_dasherize($string) (Returns a converted camel cased string into a string delimited by dashes)
  • string_ends_with($string) (Returns true if the string ends with $string)
  • string_include($string, $subString) (Returns true if the string contains the $subString)
  • string_is_alpha($string) (Return true if the string contains only letters)
  • string_is_alpha_numeric($string) (Return true if the string contains only letters and numbers)
  • string_is_lower
  • string_is_numeric($string) (Return true if the string only contains digits)
  • string_is_upper
  • string_latinise($string) (Removes accents from Latin characters)
  • string_left($string, $n) (Return the substring denoted by $n positive left-most characters)
  • string_lines($string) (Returns an array with the lines. Cross-platform compatible)
  • string_pad($string, $length, $char = ' ') (Pads the string in the center with specified character. $char may be a string or a number, defaults is a space)
  • string_pad_left($string, $length, $char = ' ') (Left pads the string)
  • string_pad_right($string, $length, $char = ' ') (Right pads the string)
  • string_repeat($string, $n) (Returns a string repeated $n times)
  • string_strip($string, $a, $b = null, $c = null) (Returns a new string with all occurrences of func_get_args()[1...])
  • string_right($string, $n) (Return the substring denoted by $n positive right-most characters)
  • string_slugify($string) (Converts the text into a valid url slug. Removes accents from Latin characters)
  • string_starts_with($string, $prefix) (Return true if the string starts with $prefix)
  • string_strip_punctuation($string) (Strip all of the punctuation)
  • string_times (Alias of string_repeat)
  • string_truncate($string, $length, $chars = '...') (Truncates the string, accounting for word placement and character count)
  • string_underscore($string) (Returns converted camel cased string into a string delimited by underscores)
  • string_titleize($string) (Creates a title version of the string. Capitalizes all the words and replaces some characters in the string to create a nicer looking title. string_titleize is meant for creating pretty output)
  • string_classify($string) (Converts string to camelized class name. First letter is always upper case)
  • string_to_sentence($array, $delimiter = ',', $lastDelimiter = '') (Join an array into a human readable sentence)
  • string_to_sentence_serial($array, $delimiter = ',', $lastDelimiter = '') (The same as string_to_sentence, but adjusts delimeters to use Serial comma)
  • string_lower_case_first
  • string_upper_case_first

PHP 8.1 : Deprecated: Optional parameter $methodArguments declared before required parameter $condition

When I run my doctrine migrations, I get this error:

Deprecated: Optional parameter $methodArguments declared before required parameter $condition is implicitly treated as a required parameter in /var/www/html/backend/vendor/funct/funct/src/Invoke.php on line 17

Faulty code is here:

function ifCondition(callable $callable, $methodArguments = [], $condition)

Optional arguments should be placed last.

String function to add prefix or suffix

Should be able to prefix/suffix a string but only if it doesn't already have the prefix.

Example:

$prefix = 'abc_';
$test = 'abc_123';
doPrefix( $test, $prefix ); // expecting 'abc_123' (no changes to $test)

Collection functions

A list of collection functions to implement for Version 0.1

  • collection_first
  • collection_last
  • collection_first_n
  • collection_last_n
  • collection_initial
  • collection_rest
  • collection_tail
  • collection_rest
  • collection_compact
  • collection_flatten
  • collection_without
  • collection_union
  • collection_intersection
  • collection_zip
  • collection_unzip
  • collection_last_index_of
  • collection_where
  • collection_find_where
  • collection_reject
  • collection_every
  • collection_some
  • collection_invoke
  • collection_pluck
  • collection_max
  • collection_min
  • collection_sort_by
  • collection_group_by
  • collection_count_by
  • collection_partition
  • collection_pairs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.