Skip to content

Extract data-type management to callables #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2015

Conversation

wdalmut
Copy link
Member

@wdalmut wdalmut commented Sep 9, 2015

Instead of switch case management, i try another way using callables in order to convert data-type to InfluxDB

@wdalmut wdalmut self-assigned this Sep 9, 2015
@wdalmut wdalmut force-pushed the feature/refactor-data-type-management branch 3 times, most recently from f0f4c63 to 140acf6 Compare September 9, 2015 18:58
@wdalmut
Copy link
Member Author

wdalmut commented Sep 9, 2015

This PR includes an idea of @gianarb in order to force data-types in #48

@gianarb
Copy link
Contributor

gianarb commented Sep 9, 2015

It sounds good.. :) In my opinion is a good solution.. It requires few works to implement it but is clear

@wdalmut wdalmut force-pushed the feature/refactor-data-type-management branch from eea24a6 to 70d12e4 Compare September 9, 2015 19:19
@wdalmut
Copy link
Member Author

wdalmut commented Sep 9, 2015

Yeah, i think so,

$client->mark("serie", [
  "data"     => new IntType("12"),
  "value"    => new StringType("username"),
  "measured" => new FloatType(12),
]);

We will keep both solutions

$client->mark("serie", [
  "data"     => 12, // as int
  "value"    => "username",  // as string
  "measured" => 12.12, // as float
]);

We will drop the int as float support that now is enabled by default

Instead of switch case management, i try another way, i use callables
in order to convert PHP data-type to InfluxDB data types
@wdalmut wdalmut force-pushed the feature/refactor-data-type-management branch from 70d12e4 to 08d0dff Compare September 9, 2015 19:57
@scrutinizer-notifier
Copy link

The inspection completed: 17 updated code elements

@wdalmut wdalmut added new feature and removed WIP labels Sep 9, 2015
wdalmut added a commit that referenced this pull request Sep 9, 2015
@wdalmut wdalmut merged commit 84f8fb5 into master Sep 9, 2015
@wdalmut wdalmut deleted the feature/refactor-data-type-management branch September 9, 2015 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants